package demo01;
import java.util.Arrays;
public class hw36 {
    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5};
        int m = 2; 

        for (int i = 0; i < m; i++) {
            int temp = array[array.length - 1];
            System.arraycopy(array, 0, array, 1, array.length - 1);
            array[0] = temp;
        }
        System.out.println(Arrays.toString(array));
    }
}
